import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { userparkVO, userparkForm, userparkQuery } from '@/api/system/userPark/types';

/**
 * 查询用户园区关联列表
 * @param query
 * @returns {*}
 */

export const listuserpark = (query?: userparkQuery): AxiosPromise<userparkVO[]> => {
  return request({
    url: '/system/userPark/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询用户园区关联详细
 * @param userParkId
 */
export const getuserpark = (userParkId: string | number): AxiosPromise<userparkVO> => {
  return request({
    url: '/system/userPark/' + userParkId,
    method: 'get'
  });
};

/**
 * 新增用户园区关联
 * @param data
 */
export const adduserpark = (data: userparkForm) => {
  return request({
    url: '/system/userPark',
    method: 'post',
    data: data
  });
};

/**
 * 修改用户园区关联
 * @param data
 */
export const updateuserpark = (data: userparkForm) => {
  return request({
    url: '/system/userPark',
    method: 'put',
    data: data
  });
};

/**
 * 删除用户园区关联
 * @param userParkId
 */
export const deluserpark = (userParkId: string | number | Array<string | number>) => {
  return request({
    url: '/system/userPark/' + userParkId,
    method: 'delete'
  });
};
